class ScorePanel {
    scoreElement: HTMLElement;
    levelElement: HTMLElement;
    private _speed:number;
    constructor(private score = 0, private level = 1, private maxLevel = 10, private upScore = 10) {
        this.scoreElement = document.getElementById('score')!;
        this.levelElement = document.getElementById('level')!;
        this.init();
    }
    init(){
        this._speed = 260;
    }
    addScore() {
        this.scoreElement.innerHTML = ++this.score + "";
        if (this._speed > 100) {
            this._speed -= 3;
        }
        if (this.score % this.upScore === 0) {
            this.levelUp();
        }
    }
    levelUp() {
        if (this.level < this.maxLevel) {
            this.levelElement.innerHTML = ++this.level + "";
            // this._speed = 260 - (this.level - 1) * 10;
        }
    }
    get speed() {
        return this._speed;
    }
}
export default ScorePanel;